﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SmartEP.DataService;
using SmartEP.DTO;
using System.Collections;
using System.Drawing;

namespace SmartEP.Presenter
{
    public class PatientCarePresenter : BasePresenter
    {
        public delegate void RegistrationStepCompletedHandler(int step);
        public RegistrationStepCompletedHandler RegistrationStepCompleted;

        public delegate void BackToPreviousRegistrationStepHandler(int step);
        public BackToPreviousRegistrationStepHandler BackToPreviousRegistrationStep;

        #region Constants
        public const int CHECK_IN_MENU = 1;
        public const int REGISTRATION_MENU = 2;
        public const int TODAY_PATIENT_MENU = 3;
        public const int SEARCH_NEW_PATIENT_MENU = 4;
        #endregion

        #region Fields
        private IBaseView _baseView;
        private int _currentSubMenu;
        #endregion

        #region Properties
        public Patient CurrentPatient { get; set; }
        public IBaseView CurrentView { get; set; }
        public int CurrentSubMenu 
        {
            get
            {
                return _currentSubMenu;
            }
            set
            {
                _currentSubMenu = value;
            }
        }
        #endregion

        #region Constructors 
        public PatientCarePresenter(Panel content)
            : base(content)
        {
        }
        #endregion

        #region Methods
        public void DisplayNextStep(int currentStep)
        {
            if (CurrentPatient == null)
            {
                CurrentPatient = new Patient();
            }

            switch (currentStep)
            {
                case 1:
                    IStep1View view = (IStep1View)CurrentView;
                    CurrentPatient.Signature = view.Signature;
                    CurrentPatient.RegistrationDate = view.SignatureDate;
                    CurrentPatient.PrintName = view.PrintName;
                    break;
                case 2:
                    break;
                case 3:
                    break;
            }

            if (RegistrationStepCompleted != null)
            {
                RegistrationStepCompleted(currentStep);
            }
        }
        public void BackToPreviousStep(int currentStep)
        {
            if (BackToPreviousRegistrationStep != null)
            {
                BackToPreviousRegistrationStep(currentStep);
            }
        }
        public void EndPatientSession()
        {
        }
        public void Logout()
        {
        }
        #endregion
    }
}
